import request from '../utils/request'

// 新建一个聊天
export function createNewChat(uid) {
    return request({
        url: '/user/chat/create/' + uid,
        method: 'get',
    })
}

// 获取用户最近的聊天列表
export function getRecentList(offset) {
    return request({
        url: '/user/chat/recent-list',
        method: 'get',
        params: {
            offset : offset
        }
    })
}

// 删除聊天
export function deleteChat(uid) {
    return request({
        url: '/user/chat/delete/' + uid,
        method: 'get',
    })
}

// 更新用户在线
export function updateWhisperOnline(from) {
    return request({
        url: '/user/chat/online',
        method: 'get',
        params: {
            from : from
        }
    })
}

// 更新用户离线
export function updateWhisperOutline(from, to) {
    return request({
        url: '/user/chat/outline',
        method: 'get',
        params: {
            from : from,
            to: to
        }
    })
}

